﻿$(function () {
    layui.use('form', function () {
        var form = layui.form,
            layer = layui.layer,
            $ = layui.jquery;
        //表单提交
        form.on('submit(submit)', function (data) {
            $.ajax({
                type: "Post",
                url: '/Function/UpdateFunction',
                data: data.field,
                async: false,
                success: function (data) {
                    if (data.success) {
                        layer.msg(data.msg, {
                            title: '提示框',
                            icon: 1,
                            time: 1000,
                            end: function () {
                                location.href = "/Function/Index";
                            }
                        });
                        
                    } else {
                        layer.alert(data.msg);
                    }
                }
            });
            return false;
        });
    });
});

